cmake_minimum_required (VERSION 2.6)
project (digmania)

set (EXECUTABLE_OUTPUT_PATH ../dist)
set (CMAKE_BUILD_TYPE Debug)

add_subdirectory(credis)

# get mercurial revision
execute_process(COMMAND hg id -n
    OUTPUT_VARIABLE _rev_ OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE version.h "#define HG_REV \"${_rev_}\"")

set (client_src
	client.c
	options.c
	render.c
)

set (client_target digmania)
if(WIN32)
	set (gl_libs opengl32 glu32)
	set (client_src ${client_src} windows.c)
else(WIN32)
	set (gl_libs GL GLU)
endif(WIN32)

add_executable(${client_target} ${client_src})
target_link_libraries(${client_target} ${gl_libs} SDL)
